#ifndef LOG_H
#define LOG_H

#include <QWidget>
#include "networkmanager.h"
// 前向声明
class Widget;
class Card;
class Bill;
namespace Ui {
class Log;
}

class Log : public QWidget
{
    Q_OBJECT

public:
    explicit Log(QWidget *parent = nullptr);
    ~Log();
    void setWidget(Widget *w);
    void setCard(Card *c);
    void setBill(Bill *b);
    void setNetworkManager(NetworkManager *manager);

private slots:
    void on_pushButton_home_clicked();//点击跳转到主页界面
    void on_pushButton_card_clicked();//点击跳转到会员界面

    void on_pushButton_bill_clicked();

    void on_pushButton_check_car_clicked();

public slots:
    void onDataReceived(const QByteArray &data); //处理接收到的数据
private:
    Ui::Log *ui;
    Widget *widget;
    Card *card;
        Bill *bill;
    NetworkManager *networkManager;

    //用于标记是否开始接收车辆信息
    bool isReceivingCarInfo = false;
    QString carCsvData;
};

#endif // LOG_H
